/*
 * logicsvrbase.h
 *
 *  Created on: 2012-6-26
 *      Author: epmm
 */

#ifndef LOGICSVRBASE_H_
#define LOGICSVRBASE_H_
#include "object.h"

class CLogicServer: public CMainframe, CSocketSelect::IOnSocket,CJobBase::IResult
{
	CSocketSelect m_UnixSvr;

public:
	CLogicServer();
	virtual ~CLogicServer();

DECLARE_DYNCREATE(CLogicServer)

public:
	virtual int InitSys(int argc, char **argv);

	virtual int InitConfig(const char* cfgfile);

	virtual int InitLog();

	virtual int InitDB();

	virtual int InitMsg();

	virtual int InitSocket();

	virtual int process();

	virtual int process(const char* pReqstr, string& Response);
public:
	virtual int OnRecv(const string& strBuffer, const int sock_fd);
	virtual int OnSecv(const string& strBuffer, const int sock_fd);
public:
	virtual int Result(CJobBase* pJob);
};

#endif /* LOGICSVRBASE_H_ */
